<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp" %>

<!DOCTYPE html>
<html>
<head>
    <title><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.button.look"/></title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp" %>
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
							
    <section class="content-header">
        <h1><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.button.look"/></h1>
        <ol class="breadcrumb">
            <li><a href="${ctx }/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.jieSuan.guanLi"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.button.look"/></a></li>
        </ol>
    </section>
    
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
            <form action="" id="form">
                <div class="form-inline">
                	<div class="form-group form-group-xs">
			         <spring:message code="message.jieSuan.chuangJianRiQi"/><spring:message code="message.yanZheng.maoHao"/>
				       <input class="form-control" type="text" id="beginDate"  name="beginDate" data-provide="datepicker" data-date-fmt="yyyy-MM-dd" placeholder="yyyy-MM-dd" />
			       		-
				       <input class="form-control" type="text" id="endDate"  name="endDate" data-provide="datepicker" data-date-fmt="yyyy-MM-dd" placeholder="yyyy-MM-dd" />
			       </div>
			       <div class="form-group form-group-xs">
			             <spring:message code="message.listForm.shenHeZhuanTai"/><spring:message code="message.yanZheng.maoHao"/>
                        <select class="form-control"  id="status" name="status">
						  <option value=""><spring:message code="message.select.option"/></option>
						  <option value="0"><spring:message code="message.select.weitijiao"/></option>
                          <option value="1"><spring:message code="message.jieSuan.yiTiJiao"/></option>
                          <option value="2"><spring:message code="message.jqGrid.cz.audit"/><spring:message code="message.jieSuan.tongGuo"/></option>
                          <option value="3"><spring:message code="message.jqGrid.cz.audit"/><spring:message code="message.listForm.buTongGuo"/></option>
                          <option value="4"><spring:message code="message.jieSuan.fuShen"/><spring:message code="message.jieSuan.tongGuo"/></option>
                          <option value="5"><spring:message code="message.jieSuan.fuShen"/><spring:message code="message.listForm.buTongGuo"/></option>
                          <option value="6"><spring:message code="message.jieSuan.naRuErJiJieSuanDan"/></option>
                          <option value="7"><spring:message code="message.jieSuan.yiNaRuZhiFuDan"/></option>
                        </select>
			       </div>
			            <button id="selectWSJ" type="button" class="btn btn-success btn-sm" onclick="gridSerch();"><spring:message code="message.button.seachSpacing"/></button>
			       </div>
                   </form>
                </div>
            </div>
        
        <table class="jqgrid" id="gridlist"></table>
		<div id="gridpage"></div>
    </section>
    
    <%@ include file="/WEB-INF/component/commonJS.jsp" %>
    <script type="text/javascript">
    
    //加载页面光标在名字框内，位于第一个
 //   $("#heaBurName").focus();
    
  //绑定回车    id="selectWSJ"  
    $('#beginDate,#endDate,#status').bind('keydown', function(event) {
        if (event.keyCode == "13") {        //13 位电脑上回车键的位置代码
            $('#selectWSJ').click();
        }
    }); 
    
        $(function () {
        	
        	jQuery("#gridlist").jqGrid({
    			url: "${ctx}/settlementFirst/getSettlementDataList.html",
    		    mtype: "POST",
    			datatype: "json",
    			autowidth: true,
    			shrinkToFit: false,
    			height: 350,
    		   	colNames:[
    		   	          '<spring:message code="message.jqGrid.cz"/>',
    		   	          '<spring:message code="message.jieSuan.jieSuanDan"/>id',
    		   	          '<spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.yanZheng.bianMa"/>',
    		   	          '<spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.listForm.mingCheng"/>',
    		   	          '<spring:message code="message.jieSuan.zongTiaoMuShu"/>',
    		   	          '<spring:message code="message.jieSuan.zongJinE"/>',
    		   	          '<spring:message code="message.jieSuan.chuangJianShiJian"/>',
    		   	          '<spring:message code="message.jieSuan.chuangJianRen"/>',
    		   	          '<spring:message code="message.lable.remark"/>',
    		   	          '<spring:message code="message.jieSuan.auditPeople"/>',
    		   	          '<spring:message code="message.jieSuan.auditTime"/>',
    		   	          '<spring:message code="message.listForm.shenHeBeiZhu"/>',
    		   	          '<spring:message code="message.listForm.shenHeZhuanTai"/>'
    		   	          ],
    		   	colModel:[
					{ name: 'oper', width:60, align:"center", sortable:false,
						formatter : function(val, opts, rowdata) {
						var str = "";
						str +="<a href='${ctx}/settlementFirst/toLookSetSettlementDetailList.html?settlementId="+rowdata.settlementId+"' style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -100px 0px' class='opIcon' title='<spring:message code="message.jqGrid.cz.xiangQing"/>'></a>";
						return str;
					} 
					},
    				{ name: 'settlementId',index : 'postOrderCode',width:162,hidden:true,align:"center" ,sortable:false},
    		   		{ name: 'settlementCode',index : 'postOrderCode', width:160, align:"center",sortable:false},
    		   		{ name: 'settlementName',index : 'postOrderCode', width:160, align:"left",sortable:false},
    		   		{ name: 'totalOrders', index : 'postOrderCode',width:80,align:"center",sortable:false},
    		   		{ name: 'totalAmount',index : 'postOrderCode', width:100,align:"right",sortable:false,
    		   			formatter : function(val, opts, rowdata) {
							return formatAmount(val, opts, rowdata);
						}
    		   		},
    		   		{ name: 'createDatetime', width:160, align:"center",sortable:false},
    		   		{ name: 'createUser', width:160, align:"left", sortable:false},
    		   		{ name: 'remarks', width:160, align:"left", sortable:false},
    		   		
    		   		{ name: 'auditUser', width:160, align:"left", sortable:false},
    		   		{ name: 'auditDatetime', width:160, align:"center", sortable:false},
    		   		{ name: 'auditRemark', width:160, align:"left", sortable:false},
    		   		{ name: 'status', width:104, align:"center", sortable:false,
    		   			formatter:function(cellvalue, options, row){
							     if(cellvalue == 0){cellvalue = "<spring:message code="message.select.weitijiao"/>";}
							else if(cellvalue == 1){cellvalue = "<spring:message code="message.jieSuan.yiTiJiao"/>";}
							else if(cellvalue == 2){cellvalue = "<spring:message code="message.jqGrid.cz.audit"/><spring:message code="message.jieSuan.tongGuo"/>";}
							else if(cellvalue == 3){cellvalue = "<spring:message code="message.jqGrid.cz.audit"/><spring:message code="message.listForm.buTongGuo"/>";}
							else if(cellvalue == 4){cellvalue = "<spring:message code="message.jieSuan.fuShen"/><spring:message code="message.jieSuan.tongGuo"/>";}
							else if(cellvalue == 5){cellvalue = "<spring:message code="message.jieSuan.fuShen"/><spring:message code="message.listForm.buTongGuo"/>";}
							else if(cellvalue == 6){cellvalue = "<spring:message code="message.jieSuan.naRuErJiJieSuanDan"/>";}
							else if(cellvalue == 7){cellvalue = "<spring:message code="message.jieSuan.yiNaRuZhiFuDan"/>";}
							return cellvalue;
						}
    		   		}
    		   		
    		   		
    		   	],
    			 rowNum: 20,
    		     rowList: [10, 20, 50, 100],
    		     rownumbers: true,
    		     pager: "#gridpage",
    		     viewrecords: true,
    		     caption: "<spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.listForm.lieBiao"/>",
    		   //序号宽度自动变化
                 gridComplete:function(){
                     //序号列宽度自适应（参数为jqgridID）
                     autoRNWidth("gridlist");
                     //数据只有一条时默认选中（参数为jqgridID）
                     selectByOneData("gridlist");
                 },
    		     jsonReader: {
    		         repeatitems: false,
    		         id: "ids"
    		     }
    		});
            
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            
            $(window).trigger("resize");
            
        });
      //查询
        function gridSerch() {
        	var data = formatForm("form");
    		$("#gridlist").jqGrid('setGridParam',{  
    	        datatype:'json',
    	        postData:data,
    	        		page:1
    	    }).trigger("reloadGrid"); //重新载入  
    	}
    </script>
</body>
</html>